home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qlib205.zip / QLIB.ZIP / TEST / FILE.ASM < prev    next >
Assembly Source File  |  1997-05-27  |  528b  |  30 lines

  1. include qlib.inc
  2. include dos.inc
  3. include string.inc
  4. include stdio.inc
  5. include process.inc
  6.  
  7. .data
  8.   buf db 256 dup (0)
  9.   db 0
  10.   h dw ?
  11.   siz dd ?
  12. .code
  13. main proc
  14.   callp print,"Test file IO...\n Dump 1st 256 bytes of file.asm:\n"
  15.   callp open,"file.asm",0
  16.   mov h,ax
  17.   .if eax==ERROR
  18.     callp printf,"Failed open\n"
  19.     call abort
  20.   .endif
  21.   callp filelength,h
  22.   mov siz,eax
  23.   callp read,h,offset buf,256
  24.   callp close,h
  25.   callp printf,offset buf
  26.   callp printf,"\n Size=%d",siz
  27.   ret
  28. main endp
  29. end
  30.